--
module("UI.Windows.KefuWin", package.seeall)

local UIUtility = require("UI.Utility")
local UIWindow = require("UI.UIWindow").UIWindow
local UIWinMgr = require("UI.UIWinMgr").UIWinMgr
local json = require("cjson")
KefuWin = UIWindow:new()

KefuWin.name = "KefuWin"


function KefuWin:Init()
    local t = self.Container.transform

    self.close_btn = UIUtility.GetChildTransform("close_btn", t, true)
    self:BindEvents()

    self.kefu1_lable = UIUtility.FindContorl("UILabel", "kefu1_lable", t)
    self.kefu2_lable = UIUtility.FindContorl("UILabel", "kefu2_lable", t)
    self.kefu3_lable = UIUtility.FindContorl("UILabel", "kefu3_lable", t)

    self.tudou_lable = UIUtility.FindContorl("UILabel", "tudou_lable", t)

    UIHelper.BindUIEvnet("Click", function()
        ToolEx.copyStr(self.kefu1_lable.text)
        UIWinMgr:OpenTextNotice("复制成功")
    end, UIUtility.GetChildTransform("fuzhi1_btn", t, true).gameObject)
    UIHelper.BindUIEvnet("Click", function()
        ToolEx.copyStr(self.kefu2_lable.text)
        UIWinMgr:OpenTextNotice("复制成功")
    end, UIUtility.GetChildTransform("fuzhi2_btn", t, true).gameObject)
    UIHelper.BindUIEvnet("Click", function()
        ToolEx.copyStr(self.kefu3_lable.text)
        UIWinMgr:OpenTextNotice("复制成功")
    end, UIUtility.GetChildTransform("fuzhi3_btn", t, true).gameObject)

    UIHelper.BindUIEvnet("Click", function()
    ToolEx.copyStr(self.tudou_lable.text)
    UIWinMgr:OpenTextNotice("复制下载地址成功")
end, UIUtility.GetChildTransform("tudou_btn", t, true).gameObject)

    UIHelper.BindUIEvnet("Click", function()
         --关闭游戏音效
    -- local SoundModule = require("Module.SoundModule").SoundModule
    -- SoundModule:SetAllBgVolume(0)

    local WebViewWindow = UIWinMgr:OpenWindow("WebViewKefuWindow")
    --   print("登录成功" .. __data.data.loginUrl)
    WebViewWindow.gamePlatformId=1
    WebViewWindow:SetUrl("https://tawk.to/chat/674467702480f5b4f5a390c0/1it81utvt")
  
    WebViewWindow:SetAudioMuted(false)
  
   
end, UIUtility.GetChildTransform("ljlx_btn", t, true).gameObject)
end

function KefuWin:OnShow()

end

function KefuWin:OnClose()

end

function KefuWin:BindEvents()
    UIHelper.BindUIEvnet("Click", function()
        self:Close(1)
    end, self.close_btn.gameObject)
end
